package com.wwwzh.himalayafm.activity;

import android.content.Intent;
import android.databinding.DataBindingUtil;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;

import com.wwwzh.himalayafm.R;
import com.wwwzh.himalayafm.databinding.ActivityWelcomBinding;
import com.wwwzh.himalayafm.entity.User;

public class WelcomActivity extends AppCompatActivity{

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_welcom);

        Intent intent = getIntent();
        ActivityWelcomBinding binding= DataBindingUtil.setContentView(this,R.layout.activity_welcom);
        User user=new User();
        user.setIcon(intent.getStringExtra("url"));
        binding.setUser(user);
        new SleepThread().start();

    }



    private class SleepThread extends Thread {

        @Override
        public void run() {
            super.run();
            try {
                Thread.sleep(3 * 1000);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            Intent intent = new Intent();
            intent.setClass(WelcomActivity.this, XmlyActivity.class);
            startActivity(intent);
            finish();
        }
    }
}
